﻿using Bids.Core.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.OpenAccess;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;

namespace Bids.Core.DomainObjects
{
	/// <summary>
	/// 网站设置
	/// </summary>
	[Serializable]
    public class System : IEntity
    {


        /// <summary>
		/// 
		/// </summary>
        public virtual int ID { set; get; }
		/// <summary>
		/// 网站名称
		/// </summary>
        public virtual string SiteName { set; get; }
		/// <summary>
		/// SEO关键字
		/// </summary>
        public virtual string Keyword { set; get; }
		/// <summary>
		/// SEO描述
		/// </summary>
        public virtual string Description { set; get; }
		/// <summary>
		/// 版权
		/// </summary>
        public virtual string Copyright { set; get; }
		/// <summary>
		/// 备案号
		/// </summary>
        public virtual string ICP { set; get; }
		/// <summary>
		/// 企业电话
		/// </summary>
        public virtual string Phone { set; get; }
		/// <summary>
		/// 传真
		/// </summary>
        public virtual string Fax { set; get; }
		/// <summary>
		/// 公司地址
		/// </summary>
        public virtual string Address { set; get; }
		/// <summary>
		/// 支付key
		/// </summary>
        public virtual string AlipayKey { set; get; }
		/// <summary>
		/// 支付合作者ID
		/// </summary>
        public virtual string AlipayPID { set; get; }
        /// <summary>
        /// 投稿期限,超时后进入选稿期
        /// </summary>
        public virtual int DaysOfSubmit { get; set; }
        /// <summary>
        /// 确认期限,选择最终稿件,超时后结束任务
        /// </summary>
        public virtual int DaysOfChoose { get; set; }
        /// <summary>
        /// 修稿期限,指定设计师修改作品,超时后确认稿件
        /// </summary>
        public virtual int DaysOfModify { get; set; }
        /// <summary>
        /// 入围奖励积分
        /// </summary>
        public virtual int FinalistScore { get; set; }
      
        public static MappingConfiguration<System> CreateConfiguration()
        {
            var threadMapping = new MappingConfiguration<System>();
            threadMapping.MapType(t => new
            {
                t.ID,
                t.SiteName,
                t.Keyword,
                t.Description,
                t.Copyright,
                t.ICP,
                t.Phone,
                t.Fax,
                t.Address,
                t.AlipayKey,
                t.AlipayPID,
                t.DaysOfChoose,
                t.DaysOfModify,
                t.DaysOfSubmit,
                t.FinalistScore
            }).ToTable("System");
            threadMapping.HasProperty(t => t.ID).IsIdentity(KeyGenerator.Autoinc);
            return threadMapping;
        }

	}
}

